!   _______________________________________________________________________________
!    _______/\\\\\\\\\_______/\\\\\\\\\______/\\\\\\\\\\\\\\__/\\\\\\\\\\\\\\\______
!     _____/\\\////////_____/\\\////////_____\/\\\//////////__\/\/////////////________
!      ___/\\\/____________/\\\/______________\/\\\____________\/\\\________/\\\\_______
!       __/\\\____________/\\\_________________\/\\\\\\\\\\\\\__\/\\\_______\////________
!        _\/\\\___________\/\\\_________________\/\\\/////////___\/\\\________/\\\\_______
!         _\//\\\__________\//\\\________________\/\\\____________\/\\\_______\////________
!          __\///\\\_________\///\\\______________\/\\\____________\/\\\______/\\\\_________
!           ____\////\\\\\\\\\____\////\\\\\\\\\___\/\\\____________\/\\\\\\\\\////__________
!            _______\/////////_______\/////////_____\///_____________\/////////_______________
!            __________________________________________________________________________________
!----------------------------------------------------------------------------------------------
!>  subroutine input_files_cgns
!>  last edit 2016-05-24
!>  last edit by liuxz
!----------------------------------------------------------------------------------------------
    subroutine modify_primitive(r1,p1,r2,p2)
    ! *************************************************************
        !>
        !>
        use global_parameter
        !>
        !>
		implicit none
        real(kind=dprec) r1,p1,&
                         r2,p2,&
                         dr,dp,&
                         coe
        coe = -0.2e0
        !>
        !>
        dp   = (p1-p2)/p2
        dr   = (r1-r2)/r2
        !>
        !>corrections the rho
        if( dr  .gt. coe) then
            r2 =  r1
        else
            r2 = r2*(1.+dr/(1.+2.0*(coe+abs(dr))))
!            r2 = r2+(r1-r2)/( 0.6 + abs(dr)*2.0 )
        end if
        !>
        !>corrections the pressure
        if(dp .gt. coe ) then
            p2 =  p1
        else
            p2 =p2*(1.+dp/(1.+2.0*(coe+abs(dp))))
        end if
        !>
        !>
        return
    end subroutine modify_primitive

